import { useEffect,useState} from "react";
import axios from "axios";
export function useTitle(title){
    useEffect(()=>{
        document.title = title
    },[title])
}

export function useProList(limit){
    const [proList,setProList] = useState([])
    useEffect(()=>{
        // 获取商品列表
        axios.get('http://121.89.205.189:3000/api/pro/list?limit='+limit)
        .then(res=>{
            setProList(res.data.data)
            
        })
    },[limit])
    return proList
}